import { p as useMainStore } from "../entry-server.js";
import { storeToRefs } from "pinia";
import { getCurrentInstance, onServerPrefetch, useSSRContext } from "vue";
function useDocumentTitle(title) {
  const mainStore = useMainStore();
  const { documentTitle } = storeToRefs(mainStore);
  const isSetup = getCurrentInstance() !== null;
  if (isSetup) {
    onServerPrefetch(() => {
      const context = useSSRContext();
      context.title = title;
    });
  }
  documentTitle.value = title;
}
export {
  useDocumentTitle as u
};
